package com.da.common.setvice.impl;

import com.da.common.entity.SnowflakeProperties;
import com.da.common.setvice.IdGenerator;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * @Author: hyacinth
 * @CreateTime: 2025-01-13
 * @Version: 1.0
 */
@Component
public class DefaultIdGenerator implements IdGenerator {
    @Resource
    private SnowflakeProperties properties;

    @Override
    public long getWorkerId() {
        return properties.getWorkerId();
    }

    @Override
    public long getDataCenterId() {
        return properties.getDataCenterId();
    }
}
